package yunquan.wang.modules.base.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;

 
@Entity
@Table(name = "BASE_ROLESINFO")
public class Rolesinfo extends IdEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4005516268335345213L;
	@Column(name = "ROLENAME")
	private String rolename;
	@ManyToMany(cascade = CascadeType.REFRESH, mappedBy = "rolesinfos", fetch = FetchType.LAZY)
	private Set<UserBasic> userBasics=new HashSet<UserBasic>(0);
	
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "rolesinfo")
    private Set<RolesAuthority> rolesAuthority=new HashSet<RolesAuthority>(0);
	public String getRolename() {
		return rolename;
	}
	public void setRolename(String rolename) {
		this.rolename = rolename;
	}
	public Set<UserBasic> getUserBasics() {
		return userBasics;
	}
	public void setUserBasics(Set<UserBasic> userBasics) {
		this.userBasics = userBasics;
	}
	public Set<RolesAuthority> getRolesAuthority() {
		return rolesAuthority;
	}
	public void setRolesAuthority(Set<RolesAuthority> rolesAuthority) {
		this.rolesAuthority = rolesAuthority;
	}
	 
    
    
    
}
